package com.gcph.zhuoba.main.Fragment;

import com.gcph.zhuoba.R;
import com.gcph.zhuoba.app.GcphApplication;
import com.gcph.zhuoba.main.activitys.LoginActivity;
import com.gcph.zhuoba.main.activitys.MainActivity;
import com.gcph.zhuoba.main.activitys.UcenterTutorActivity;
import com.gcph.zhuoba.util.SharePreferenceUtil;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;

public class PersonalFragment extends Fragment {
	
	private Button app_exit;
	private SharePreferenceUtil spUtil;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View settingLayout = inflater.inflate(R.layout.layout_personal,container, false);
		ImageView iv=(ImageView)settingLayout.findViewById(R.id.personal_list);
		iv.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent intent=new Intent(getActivity(),UcenterTutorActivity.class);
				startActivity(intent);
			}
		});
		
		
		//退出当前账号
		spUtil = GcphApplication.getInstance().getSpUtil();
		app_exit=(Button)settingLayout.findViewById(R.id.app_exit);
		app_exit.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				spUtil.setUserType("");
				android.os.Process.killProcess(android.os.Process.myPid()); 
			    System.exit(0);
			}
		});
		return settingLayout;
	}
}